<?php
/**
 * Created by PhpStorm.
 * User: zhan
 * Date: 2018/10/9  17:33
 */
namespace app\admin\controller;

class Platform extends Common
{

    /*
    *	构造函数
    */
    function __construct()
    {
        parent::__construct();
    }

    public function lists()
    {
        $where = [];

        $keyword = input("keyword");
        if($keyword != ''){
            $where['account']=array("like",'%'.input('keyword').'%');
            $pageParam['query']['keyword'] = $keyword;
        }

        $data = db('amount_log')->alias('al')->join('admin_member am','am.id=al.user_id')->where($where)->order('id desc')->field('al.*,am.account')->paginate(15)->each(function($item, $key){
            $item['createtime'] = date('Y-m-d H:i:s',$item['createtime']);
            return $item;
        });

        $this->assign('list', $data);
        $this->assign('keyword', $keyword);
        $this->assign('page', $data->render());
        return $this->fetch();
    }
}